<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>IgH EtherCAT Master: device.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">IgH EtherCAT Master
   &#160;<span id="projectnumber">1.5.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('device_8h_source.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">device.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="device_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *  $Id: device.h,v 5cf6bb14a579 2012/11/30 19:25:18 fp $</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *  Copyright (C) 2006-2008  Florian Pose, Ingenieurgemeinschaft IgH</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *  This file is part of the IgH EtherCAT Master.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> *  The IgH EtherCAT Master is free software; you can redistribute it and/or</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *  modify it under the terms of the GNU General Public License version 2, as</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> *  published by the Free Software Foundation.</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *  The IgH EtherCAT Master is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *  but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *  Public License for more details.</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *  You should have received a copy of the GNU General Public License along</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> *  with the IgH EtherCAT Master; if not, write to the Free Software</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> *  ---</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> *  The license mentioned above concerns the source code only. Using the</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> *  EtherCAT technology and brand is only permitted in compliance with the</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> *  industrial property and similar rights of Beckhoff Automation GmbH.</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> *****************************************************************************/</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#ifndef __EC_DEVICE_H__</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#define __EC_DEVICE_H__</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &lt;linux/interrupt.h&gt;</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &quot;../devices/ecdev.h&quot;</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="globals_8h.html">globals.h</a>&quot;</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="device_8h.html#a8e81effb90ab4150ac1fe4114e7775f0">   51</a></span>&#160;<span class="preprocessor">#define EC_TX_RING_SIZE 2</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor">#ifdef EC_DEBUG_IF</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="debug_8h.html">debug.h</a>&quot;</span></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor">#ifdef EC_DEBUG_RING</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">#define EC_DEBUG_RING_SIZE 10</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> {</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    TX, RX</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;} ec_debug_frame_dir_t;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    ec_debug_frame_dir_t dir;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keyword">struct </span>timeval t;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    uint8_t data[<a class="code" href="globals_8h.html#a1e04c301942ee12b54c2caa25d3caab5">EC_MAX_DATA_SIZE</a>];</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> data_size;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;} ec_debug_frame_t;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="structec__device.html">   81</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structec__device.html">ec_device</a></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;{</div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="structec__device.html#a3678edcc317d6324936b02c4509de443">   83</a></span>&#160;    <a class="code" href="structec__master.html">ec_master_t</a> *<a class="code" href="structec__device.html#a3678edcc317d6324936b02c4509de443">master</a>; </div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="structec__device.html#a9503692598d3950969ca8b4daf5fd5ac">   84</a></span>&#160;    <span class="keyword">struct </span>net_device *<a class="code" href="structec__device.html#a9503692598d3950969ca8b4daf5fd5ac">dev</a>; </div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="structec__device.html#aa51d769eb590a04e98f8544ea758322f">   85</a></span>&#160;    <a class="code" href="ecdev_8h.html#a789bcd88d869f88c58bd13b451b3fd52">ec_pollfunc_t</a> <a class="code" href="structec__device.html#aa51d769eb590a04e98f8544ea758322f">poll</a>; </div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="structec__device.html#a79af9075672aa2abf993a703b4d964ed">   86</a></span>&#160;    <span class="keyword">struct </span>module *<a class="code" href="structec__device.html#a79af9075672aa2abf993a703b4d964ed">module</a>; </div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="structec__device.html#a0a3f5a12926e0d4ef17409d05b36d18a">   87</a></span>&#160;    uint8_t <a class="code" href="structec__device.html#a0a3f5a12926e0d4ef17409d05b36d18a">open</a>; </div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="structec__device.html#ab58236227ed28e568e0de571499d5e68">   88</a></span>&#160;    uint8_t <a class="code" href="structec__device.html#ab58236227ed28e568e0de571499d5e68">link_state</a>; </div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="structec__device.html#a733aeb60035ac3696f05dc33adf49004">   89</a></span>&#160;    <span class="keyword">struct </span>sk_buff *tx_skb[<a class="code" href="device_8h.html#a8e81effb90ab4150ac1fe4114e7775f0">EC_TX_RING_SIZE</a>]; </div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="structec__device.html#af9353b63b910b0b64d06837b3f7075b7">   90</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structec__device.html#af9353b63b910b0b64d06837b3f7075b7">tx_ring_index</a>; </div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor">#ifdef EC_HAVE_CYCLES</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    cycles_t cycles_poll; </div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="preprocessor">#ifdef EC_DEBUG_RING</span></div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="keyword">struct </span>timeval timeval_poll;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="structec__device.html#af98c616a488455db59c5c4297206b8fb">   97</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="structec__device.html#af98c616a488455db59c5c4297206b8fb">jiffies_poll</a>; </div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="comment">// Frame statistics</span></div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="structec__device.html#a0cdf625147761dedcd8aa0ee08434949">  100</a></span>&#160;    u64 <a class="code" href="structec__device.html#a0cdf625147761dedcd8aa0ee08434949">tx_count</a>; </div><div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="structec__device.html#afca221601cff7e6280283df48902a019">  101</a></span>&#160;    u64 <a class="code" href="structec__device.html#afca221601cff7e6280283df48902a019">last_tx_count</a>; </div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="structec__device.html#ab53eaa1db2b7696c28f06146fd253786">  102</a></span>&#160;    u64 <a class="code" href="structec__device.html#ab53eaa1db2b7696c28f06146fd253786">rx_count</a>; </div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="structec__device.html#a5ad25fde7d43696988dcb602fa947a7b">  103</a></span>&#160;    u64 <a class="code" href="structec__device.html#a5ad25fde7d43696988dcb602fa947a7b">last_rx_count</a>; </div><div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="structec__device.html#a969a3e6f0057eeb8b1becc34d500e281">  105</a></span>&#160;    u64 <a class="code" href="structec__device.html#a969a3e6f0057eeb8b1becc34d500e281">tx_bytes</a>; </div><div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="structec__device.html#ac4a738c0943134edc5c68f2c85b9a089">  106</a></span>&#160;    u64 <a class="code" href="structec__device.html#ac4a738c0943134edc5c68f2c85b9a089">last_tx_bytes</a>; </div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="structec__device.html#afea25f45c6911c97a08b8615154a2b91">  107</a></span>&#160;    u64 <a class="code" href="structec__device.html#afea25f45c6911c97a08b8615154a2b91">rx_bytes</a>; </div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="structec__device.html#a53f0337afe2d2bdb4b24e2ee4ccb8180">  108</a></span>&#160;    u64 <a class="code" href="structec__device.html#a53f0337afe2d2bdb4b24e2ee4ccb8180">last_rx_bytes</a>; </div><div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="structec__device.html#a076ce4fd0d53e53ba7236b12bf4ecf66">  110</a></span>&#160;    u64 <a class="code" href="structec__device.html#a076ce4fd0d53e53ba7236b12bf4ecf66">tx_errors</a>; </div><div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="structec__device.html#a0de91079b171a6b07cb724a6362f340b">  111</a></span>&#160;    s32 tx_frame_rates[<a class="code" href="globals_8h.html#a00b477d166c2d09b9fea5d43c0c1cd48">EC_RATE_COUNT</a>]; </div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="structec__device.html#a8e78783b1d22fd12b5d2abe263184bb1">  114</a></span>&#160;    s32 rx_frame_rates[<a class="code" href="globals_8h.html#a00b477d166c2d09b9fea5d43c0c1cd48">EC_RATE_COUNT</a>]; </div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="structec__device.html#a5decb734bd07c7e1a1b66e08904f0bba">  117</a></span>&#160;    s32 tx_byte_rates[<a class="code" href="globals_8h.html#a00b477d166c2d09b9fea5d43c0c1cd48">EC_RATE_COUNT</a>]; </div><div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="structec__device.html#a577e0651d974aa3db43fcb8fab639637">  119</a></span>&#160;    s32 rx_byte_rates[<a class="code" href="globals_8h.html#a00b477d166c2d09b9fea5d43c0c1cd48">EC_RATE_COUNT</a>]; </div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="preprocessor">#ifdef EC_DEBUG_IF</span></div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <a class="code" href="structec__debug__t.html">ec_debug_t</a> dbg; </div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="preprocessor">#ifdef EC_DEBUG_RING</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    ec_debug_frame_t debug_frames[EC_DEBUG_RING_SIZE];</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> debug_frame_index;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> debug_frame_count;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;};</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="keywordtype">int</span> <a class="code" href="device_8h.html#a02288d2a8148ced6479c1285f9dc2bd1">ec_device_init</a>(<a class="code" href="structec__device.html">ec_device_t</a> *, <a class="code" href="structec__master.html">ec_master_t</a> *);</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="keywordtype">void</span> <a class="code" href="device_8h.html#a3099aa0e5bfa03897b85f4b542108d87">ec_device_clear</a>(<a class="code" href="structec__device.html">ec_device_t</a> *);</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="keywordtype">void</span> <a class="code" href="device_8h.html#a7f14ad3873acec6c4aab27a403b86e2f">ec_device_attach</a>(<a class="code" href="structec__device.html">ec_device_t</a> *, <span class="keyword">struct</span> net_device *, <a class="code" href="ecdev_8h.html#a789bcd88d869f88c58bd13b451b3fd52">ec_pollfunc_t</a>,</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        <span class="keyword">struct</span> module *);</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="keywordtype">void</span> <a class="code" href="device_8h.html#a6aa86617de7ed991048e151847683a01">ec_device_detach</a>(<a class="code" href="structec__device.html">ec_device_t</a> *);</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="keywordtype">int</span> <a class="code" href="device_8h.html#abddc8be76e9422963c7814777bf80525">ec_device_open</a>(<a class="code" href="structec__device.html">ec_device_t</a> *);</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;<span class="keywordtype">int</span> <a class="code" href="device_8h.html#afb0366cde94e727915b7bc0edd82e9d4">ec_device_close</a>(<a class="code" href="structec__device.html">ec_device_t</a> *);</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;<span class="keywordtype">void</span> <a class="code" href="device_8h.html#ae9ba13e6b8f14f6633250f176e82bec2">ec_device_poll</a>(<a class="code" href="structec__device.html">ec_device_t</a> *);</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;uint8_t *<a class="code" href="device_8h.html#a5f9614c819d9e94aaea708f3351e2826">ec_device_tx_data</a>(<a class="code" href="structec__device.html">ec_device_t</a> *);</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;<span class="keywordtype">void</span> <a class="code" href="device_8h.html#acbce72d98a923245aca830dd82d2b36f">ec_device_send</a>(<a class="code" href="structec__device.html">ec_device_t</a> *, <span class="keywordtype">size_t</span>);</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="keywordtype">void</span> <a class="code" href="device_8h.html#a2889ce889e3a481040666349d4220829">ec_device_clear_stats</a>(<a class="code" href="structec__device.html">ec_device_t</a> *);</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;<span class="keywordtype">void</span> <a class="code" href="device_8h.html#a487e82c3004aafd09d2a2b993960ee60">ec_device_update_stats</a>(<a class="code" href="structec__device.html">ec_device_t</a> *);</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;<span class="preprocessor">#ifdef EC_DEBUG_RING</span></div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="keywordtype">void</span> ec_device_debug_ring_append(<a class="code" href="structec__device.html">ec_device_t</a> *, ec_debug_frame_dir_t,</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keywordtype">size_t</span>);</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<span class="keywordtype">void</span> ec_device_debug_ring_print(<span class="keyword">const</span> <a class="code" href="structec__device.html">ec_device_t</a> *);</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="device_8h_html_a7f14ad3873acec6c4aab27a403b86e2f"><div class="ttname"><a href="device_8h.html#a7f14ad3873acec6c4aab27a403b86e2f">ec_device_attach</a></div><div class="ttdeci">void ec_device_attach(ec_device_t *, struct net_device *, ec_pollfunc_t, struct module *)</div><div class="ttdoc">Associate with net_device. </div><div class="ttdef"><b>Definition:</b> <a href="device_8c_source.html#l00182">device.c:182</a></div></div>
<div class="ttc" id="structec__device_html_aa51d769eb590a04e98f8544ea758322f"><div class="ttname"><a href="structec__device.html#aa51d769eb590a04e98f8544ea758322f">ec_device::poll</a></div><div class="ttdeci">ec_pollfunc_t poll</div><div class="ttdoc">pointer to the device&amp;#39;s poll function </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00085">device.h:85</a></div></div>
<div class="ttc" id="structec__device_html_af98c616a488455db59c5c4297206b8fb"><div class="ttname"><a href="structec__device.html#af98c616a488455db59c5c4297206b8fb">ec_device::jiffies_poll</a></div><div class="ttdeci">unsigned long jiffies_poll</div><div class="ttdoc">jiffies of last poll </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00097">device.h:97</a></div></div>
<div class="ttc" id="debug_8h_html"><div class="ttname"><a href="debug_8h.html">debug.h</a></div><div class="ttdoc">Network interface for debugging purposes. </div></div>
<div class="ttc" id="structec__device_html_afca221601cff7e6280283df48902a019"><div class="ttname"><a href="structec__device.html#afca221601cff7e6280283df48902a019">ec_device::last_tx_count</a></div><div class="ttdeci">u64 last_tx_count</div><div class="ttdoc">Number of frames sent of last statistics cycle. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00101">device.h:101</a></div></div>
<div class="ttc" id="globals_8h_html_a00b477d166c2d09b9fea5d43c0c1cd48"><div class="ttname"><a href="globals_8h.html#a00b477d166c2d09b9fea5d43c0c1cd48">EC_RATE_COUNT</a></div><div class="ttdeci">#define EC_RATE_COUNT</div><div class="ttdoc">Number of statistic rate intervals to maintain. </div><div class="ttdef"><b>Definition:</b> <a href="globals_8h_source.html#l00072">globals.h:72</a></div></div>
<div class="ttc" id="device_8h_html_a5f9614c819d9e94aaea708f3351e2826"><div class="ttname"><a href="device_8h.html#a5f9614c819d9e94aaea708f3351e2826">ec_device_tx_data</a></div><div class="ttdeci">uint8_t * ec_device_tx_data(ec_device_t *)</div><div class="ttdoc">Returns a pointer to the device&amp;#39;s transmit memory. </div><div class="ttdef"><b>Definition:</b> <a href="device_8c_source.html#l00312">device.c:312</a></div></div>
<div class="ttc" id="structec__device_html_a79af9075672aa2abf993a703b4d964ed"><div class="ttname"><a href="structec__device.html#a79af9075672aa2abf993a703b4d964ed">ec_device::module</a></div><div class="ttdeci">struct module * module</div><div class="ttdoc">pointer to the device&amp;#39;s owning module </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00086">device.h:86</a></div></div>
<div class="ttc" id="structec__debug__t_html"><div class="ttname"><a href="structec__debug__t.html">ec_debug_t</a></div><div class="ttdoc">Debugging network interface. </div><div class="ttdef"><b>Definition:</b> <a href="debug_8h_source.html#l00046">debug.h:46</a></div></div>
<div class="ttc" id="structec__device_html_ab58236227ed28e568e0de571499d5e68"><div class="ttname"><a href="structec__device.html#ab58236227ed28e568e0de571499d5e68">ec_device::link_state</a></div><div class="ttdeci">uint8_t link_state</div><div class="ttdoc">device link state </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00088">device.h:88</a></div></div>
<div class="ttc" id="structec__device_html_ab53eaa1db2b7696c28f06146fd253786"><div class="ttname"><a href="structec__device.html#ab53eaa1db2b7696c28f06146fd253786">ec_device::rx_count</a></div><div class="ttdeci">u64 rx_count</div><div class="ttdoc">Number of frames received. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00102">device.h:102</a></div></div>
<div class="ttc" id="structec__device_html_ac4a738c0943134edc5c68f2c85b9a089"><div class="ttname"><a href="structec__device.html#ac4a738c0943134edc5c68f2c85b9a089">ec_device::last_tx_bytes</a></div><div class="ttdeci">u64 last_tx_bytes</div><div class="ttdoc">Number of bytes sent of last statistics cycle. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00106">device.h:106</a></div></div>
<div class="ttc" id="globals_8h_html"><div class="ttname"><a href="globals_8h.html">globals.h</a></div><div class="ttdoc">Global definitions and macros. </div></div>
<div class="ttc" id="device_8h_html_a6aa86617de7ed991048e151847683a01"><div class="ttname"><a href="device_8h.html#a6aa86617de7ed991048e151847683a01">ec_device_detach</a></div><div class="ttdeci">void ec_device_detach(ec_device_t *)</div><div class="ttdoc">Disconnect from net_device. </div><div class="ttdef"><b>Definition:</b> <a href="device_8c_source.html#l00213">device.c:213</a></div></div>
<div class="ttc" id="device_8h_html_a8e81effb90ab4150ac1fe4114e7775f0"><div class="ttname"><a href="device_8h.html#a8e81effb90ab4150ac1fe4114e7775f0">EC_TX_RING_SIZE</a></div><div class="ttdeci">#define EC_TX_RING_SIZE</div><div class="ttdoc">Size of the transmit ring. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00051">device.h:51</a></div></div>
<div class="ttc" id="structec__device_html_a5ad25fde7d43696988dcb602fa947a7b"><div class="ttname"><a href="structec__device.html#a5ad25fde7d43696988dcb602fa947a7b">ec_device::last_rx_count</a></div><div class="ttdeci">u64 last_rx_count</div><div class="ttdoc">Number of frames received of last statistics cycle. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00103">device.h:103</a></div></div>
<div class="ttc" id="ecdev_8h_html_a789bcd88d869f88c58bd13b451b3fd52"><div class="ttname"><a href="ecdev_8h.html#a789bcd88d869f88c58bd13b451b3fd52">ec_pollfunc_t</a></div><div class="ttdeci">void(* ec_pollfunc_t)(struct net_device *)</div><div class="ttdoc">Device poll function type. </div><div class="ttdef"><b>Definition:</b> <a href="ecdev_8h_source.html#l00057">ecdev.h:57</a></div></div>
<div class="ttc" id="structec__device_html"><div class="ttname"><a href="structec__device.html">ec_device</a></div><div class="ttdoc">EtherCAT device. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00081">device.h:81</a></div></div>
<div class="ttc" id="structec__device_html_af9353b63b910b0b64d06837b3f7075b7"><div class="ttname"><a href="structec__device.html#af9353b63b910b0b64d06837b3f7075b7">ec_device::tx_ring_index</a></div><div class="ttdeci">unsigned int tx_ring_index</div><div class="ttdoc">last ring entry used to transmit </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00090">device.h:90</a></div></div>
<div class="ttc" id="device_8h_html_ae9ba13e6b8f14f6633250f176e82bec2"><div class="ttname"><a href="device_8h.html#ae9ba13e6b8f14f6633250f176e82bec2">ec_device_poll</a></div><div class="ttdeci">void ec_device_poll(ec_device_t *)</div><div class="ttdoc">Calls the poll function of the assigned net_device. </div><div class="ttdef"><b>Definition:</b> <a href="device_8c_source.html#l00478">device.c:478</a></div></div>
<div class="ttc" id="device_8h_html_a2889ce889e3a481040666349d4220829"><div class="ttname"><a href="device_8h.html#a2889ce889e3a481040666349d4220829">ec_device_clear_stats</a></div><div class="ttdeci">void ec_device_clear_stats(ec_device_t *)</div><div class="ttdoc">Clears the frame statistics. </div><div class="ttdef"><b>Definition:</b> <a href="device_8c_source.html#l00374">device.c:374</a></div></div>
<div class="ttc" id="structec__device_html_a3678edcc317d6324936b02c4509de443"><div class="ttname"><a href="structec__device.html#a3678edcc317d6324936b02c4509de443">ec_device::master</a></div><div class="ttdeci">ec_master_t * master</div><div class="ttdoc">EtherCAT master. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00083">device.h:83</a></div></div>
<div class="ttc" id="structec__device_html_afea25f45c6911c97a08b8615154a2b91"><div class="ttname"><a href="structec__device.html#afea25f45c6911c97a08b8615154a2b91">ec_device::rx_bytes</a></div><div class="ttdeci">u64 rx_bytes</div><div class="ttdoc">Number of bytes received. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00107">device.h:107</a></div></div>
<div class="ttc" id="structec__device_html_a0cdf625147761dedcd8aa0ee08434949"><div class="ttname"><a href="structec__device.html#a0cdf625147761dedcd8aa0ee08434949">ec_device::tx_count</a></div><div class="ttdeci">u64 tx_count</div><div class="ttdoc">Number of frames sent. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00100">device.h:100</a></div></div>
<div class="ttc" id="device_8h_html_a02288d2a8148ced6479c1285f9dc2bd1"><div class="ttname"><a href="device_8h.html#a02288d2a8148ced6479c1285f9dc2bd1">ec_device_init</a></div><div class="ttdeci">int ec_device_init(ec_device_t *, ec_master_t *)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> <a href="device_8c_source.html#l00063">device.c:63</a></div></div>
<div class="ttc" id="structec__device_html_a0a3f5a12926e0d4ef17409d05b36d18a"><div class="ttname"><a href="structec__device.html#a0a3f5a12926e0d4ef17409d05b36d18a">ec_device::open</a></div><div class="ttdeci">uint8_t open</div><div class="ttdoc">true, if the net_device has been opened </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00087">device.h:87</a></div></div>
<div class="ttc" id="structec__device_html_a076ce4fd0d53e53ba7236b12bf4ecf66"><div class="ttname"><a href="structec__device.html#a076ce4fd0d53e53ba7236b12bf4ecf66">ec_device::tx_errors</a></div><div class="ttdeci">u64 tx_errors</div><div class="ttdoc">Number of transmit errors. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00110">device.h:110</a></div></div>
<div class="ttc" id="structec__device_html_a53f0337afe2d2bdb4b24e2ee4ccb8180"><div class="ttname"><a href="structec__device.html#a53f0337afe2d2bdb4b24e2ee4ccb8180">ec_device::last_rx_bytes</a></div><div class="ttdeci">u64 last_rx_bytes</div><div class="ttdoc">Number of bytes received of last statistics cycle. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00108">device.h:108</a></div></div>
<div class="ttc" id="device_8h_html_a487e82c3004aafd09d2a2b993960ee60"><div class="ttname"><a href="device_8h.html#a487e82c3004aafd09d2a2b993960ee60">ec_device_update_stats</a></div><div class="ttdeci">void ec_device_update_stats(ec_device_t *)</div><div class="ttdoc">Update device statistics. </div><div class="ttdef"><b>Definition:</b> <a href="device_8c_source.html#l00496">device.c:496</a></div></div>
<div class="ttc" id="device_8h_html_a3099aa0e5bfa03897b85f4b542108d87"><div class="ttname"><a href="device_8h.html#a3099aa0e5bfa03897b85f4b542108d87">ec_device_clear</a></div><div class="ttdeci">void ec_device_clear(ec_device_t *)</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> <a href="device_8c_source.html#l00162">device.c:162</a></div></div>
<div class="ttc" id="device_8h_html_acbce72d98a923245aca830dd82d2b36f"><div class="ttname"><a href="device_8h.html#acbce72d98a923245aca830dd82d2b36f">ec_device_send</a></div><div class="ttdeci">void ec_device_send(ec_device_t *, size_t)</div><div class="ttdoc">Sends the content of the transmit socket buffer. </div><div class="ttdef"><b>Definition:</b> <a href="device_8c_source.html#l00331">device.c:331</a></div></div>
<div class="ttc" id="device_8h_html_abddc8be76e9422963c7814777bf80525"><div class="ttname"><a href="device_8h.html#abddc8be76e9422963c7814777bf80525">ec_device_open</a></div><div class="ttdeci">int ec_device_open(ec_device_t *)</div><div class="ttdoc">Opens the EtherCAT device. </div><div class="ttdef"><b>Definition:</b> <a href="device_8c_source.html#l00242">device.c:242</a></div></div>
<div class="ttc" id="device_8h_html_afb0366cde94e727915b7bc0edd82e9d4"><div class="ttname"><a href="device_8h.html#afb0366cde94e727915b7bc0edd82e9d4">ec_device_close</a></div><div class="ttdeci">int ec_device_close(ec_device_t *)</div><div class="ttdoc">Stops the EtherCAT device. </div><div class="ttdef"><b>Definition:</b> <a href="device_8c_source.html#l00279">device.c:279</a></div></div>
<div class="ttc" id="structec__device_html_a9503692598d3950969ca8b4daf5fd5ac"><div class="ttname"><a href="structec__device.html#a9503692598d3950969ca8b4daf5fd5ac">ec_device::dev</a></div><div class="ttdeci">struct net_device * dev</div><div class="ttdoc">pointer to the assigned net_device </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00084">device.h:84</a></div></div>
<div class="ttc" id="structec__master_html"><div class="ttname"><a href="structec__master.html">ec_master</a></div><div class="ttdoc">EtherCAT master. </div><div class="ttdef"><b>Definition:</b> <a href="master_8h_source.html#l00194">master.h:194</a></div></div>
<div class="ttc" id="structec__device_html_a969a3e6f0057eeb8b1becc34d500e281"><div class="ttname"><a href="structec__device.html#a969a3e6f0057eeb8b1becc34d500e281">ec_device::tx_bytes</a></div><div class="ttdeci">u64 tx_bytes</div><div class="ttdoc">Number of bytes sent. </div><div class="ttdef"><b>Definition:</b> <a href="device_8h_source.html#l00105">device.h:105</a></div></div>
<div class="ttc" id="globals_8h_html_a1e04c301942ee12b54c2caa25d3caab5"><div class="ttname"><a href="globals_8h.html#a1e04c301942ee12b54c2caa25d3caab5">EC_MAX_DATA_SIZE</a></div><div class="ttdeci">#define EC_MAX_DATA_SIZE</div><div class="ttdoc">Resulting maximum data size of a single datagram in a frame. </div><div class="ttdef"><b>Definition:</b> <a href="globals_8h_source.html#l00091">globals.h:91</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_c1346cf4828efdd0d2baf0d391d01b77.html">master</a></li><li class="navelem"><a class="el" href="device_8h.html">device.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
